home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Sample Code / Snippets / QuickDraw / Imageer 1.0.0d3 / source / eventloop.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-16  |  1.1 KB  |  59 lines  |  [TEXT/MPS ]

  1. /****************************************************/
  2. /*                                                    */
  3. /*    File:        eventloop.c                            */
  4. /*                                                    */
  5. /*    Program:    Imageer                                */
  6. /*                                                    */
  7. /*    By:            Jason Hodges-Harris                    */
  8. /*                                                    */
  9. /*    Created:    26/10/95  00:00:00 AM                */
  10. /*                                                    */
  11. /*    Version:    1.0.0d3                                */
  12. /*                                                    */
  13. /*    Copyright:    © 1995-96 Apple Computer, Inc.,        */ 
  14. /*                    all rights reserved.            */        
  15. /*                                                    */
  16. /****************************************************/
  17.  
  18.  
  19. /**** Macintosh Toolbox Headers *****/
  20.  
  21. #ifndef __EVENTS__
  22. #include <Events.h>
  23. #endif
  24.  
  25.  
  26. /****   Application headers and prototypes   ****/
  27.  
  28.  
  29. #ifndef __IMAGEERAPPHEADER__
  30. #include "Imageer.app.h"
  31. #endif
  32.  
  33. #ifndef __IMAGEERPROTOSHEADER__
  34. #include "Imageer.protos.h"
  35. #endif
  36.  
  37.  
  38. //    Global Variables
  39.  
  40. extern Boolean        gDone;                // program loop test condition
  41.  
  42.  
  43. // EventLoop handles the application's main WNE loop
  44. // and is called from within the main() function.
  45.  
  46. #pragma segment Main
  47. void EventLoop (void)
  48. {
  49.     EventRecord    event;
  50.     
  51.     while (!gDone)
  52.     {
  53.         if (WaitNextEvent (everyEvent,&event,kSleep,nil))
  54.         {
  55.             DoEvent (&event);
  56.         }
  57.     }
  58. }
  59.